package severlet;

import dao.StudentDao;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet(name = "AdminDelStudentServlet", value = "/AdminDelStudentServlet")
public class AdminDelStudentServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("utf-8");
        String studentid = request.getParameter("studentid");

        //dao
        StudentDao studentDao=new StudentDao();
        studentDao.delInfo(studentid);

        request.getRequestDispatcher("admin_information.jsp").forward(request,response);
    }
}
